// Copyright 2008 Chris Varley (http://www.contractdriven.net/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using NUnit.Framework;
using NUnit_Assert = NUnit.Framework.Assert;
using Contract_Assert = ContractDriven.Assert;

namespace ContractDrivenTests
{
    /// <summary>
    /// Tests for the Assert Class, which provides factory methods for CommonAssertions
    /// </summary>
    [TestFixture, Description("Tests for Static Assert Methods")]
    public class AssertTest
    {

		[Test(Description="Tests Factory method. Creates an IsInRange Assertion")]
        public void IsInRangeTest()
        {
			var rangeAssertion = Contract_Assert.IsInRange(1, 1, 2);
			NUnit_Assert.IsNotNull(rangeAssertion);
		}

        [Test(Description="Tests Factory method. Creates an IsLengthInRange Assertion")]
        public void IsLengthInRangeTest()
        {
            var stringLengthAssertion = Contract_Assert.IsLengthInRange("test", 0, 10);
			NUnit_Assert.IsNotNull(stringLengthAssertion);
		}

        [Test(Description="Tests Factory method. Creates an IsNotNull Assertion")]
        public void IsNotNullTest()
        {

        	var isNotNullAssertion = Contract_Assert.IsNotNull("test");
			NUnit_Assert.IsNotNull(isNotNullAssertion);
		}

        [Test(Description="Tests Factory method. Creates an IsNotNullOrEmpty Assertion")]
        public void IsNotNullOrEmptyTest()
        {
        	var isNotNullOrEmptyAssertion = Contract_Assert.IsNotNullOrEmpty("test");
			NUnit_Assert.IsNotNull(isNotNullOrEmptyAssertion);
		}

        [Test(Description = "Tests Factory method. Creates an Contains Assertion")]
        public void ContainsTest()
        {
            var containsAssertion = Contract_Assert.Contains("Chris", "Christmas");
            NUnit_Assert.IsNotNull(containsAssertion);
        }

        [Test(Description = "Tests Factory method. Creates an True Assertion")]
        public void TrueTest()
        {
            var trueAssertion = Contract_Assert.True(true);
            NUnit_Assert.IsNotNull(trueAssertion);
        }

        [Test(Description = "Tests Factory method. Creates an False Assertion")]
        public void FalseTest()
        {
            var falseAssertion = Contract_Assert.False(false);
            NUnit_Assert.IsNotNull(falseAssertion);
        }
    }
}
